package com.example.radiationarea.world.biome;

import com.example.radiationarea.RadiationAreaMod;
import com.mojang.datafixers.util.Pair;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.biome.Climate;
import terrablender.api.Region;
import terrablender.api.RegionType;

import java.util.function.Consumer;

public class RadiationRegion extends Region {
    public static final ResourceLocation LOCATION = new ResourceLocation(RadiationAreaMod.MOD_ID, "radiation_region");
    public static final int REGION_WEIGHT = 10;
    
    public RadiationRegion() {
        super(LOCATION, RegionType.OVERWORLD, REGION_WEIGHT);
    }

    @Override
    public void addBiomes(Registry<Biome> biomeRegistry, Consumer<Pair<Climate.ParameterPoint, ResourceKey<Biome>>> mapper) {
        RadiationAreaMod.LOGGER.info("Adding biomes to RadiationRegion");
        
        // Add radiation zone biome with specific climate parameters
        mapper.accept(Pair.of(
            new Climate.ParameterPoint(
                Climate.Parameter.span(-0.5F, 0.5F),   // Temperature range
                Climate.Parameter.span(-0.5F, 0.5F),   // Humidity range
                Climate.Parameter.span(-0.3F, 0.3F),   // Continentalness range
                Climate.Parameter.span(-0.3F, 0.3F),   // Erosion range
                Climate.Parameter.point(0.0F),         // Depth
                Climate.Parameter.span(-0.2F, 0.2F),   // Weirdness range
                0L                                     // Offset
            ), 
            ModBiomes.RADIATION_ZONE
        ));
        
        RadiationAreaMod.LOGGER.info("Successfully added radiation biome to parameter list");
    }
}